#!/bin/sh

#syncthing
#https://www.youtube.com/watch?v=8bHdcfVzrgk

#btrfs
# https://www.youtube.com/watch?v=J2QP4onqJKI
#doas btrfs subv list $* # Display all subvolumes(+backups) for a volume
#doas mount -o subvolid=$1 /dev/disk/by-id/$2 /mnt # Mount a subvolume by id to /mnt, helpful for searching backups
#doas btrfs fi du $* -s # Print volume usage
#doas btrfs fi df $* -s # Same as above but with more info
#doas btrfs fi show # Prints drive and device info
#doas btrfs scrub start $* # Cleans extra data
#doas btrfs balance start -musage=50 -dusage=50 $* # Balances out data usage on drives in a subvolume

#rsync
#https://www.youtube.com/watch?v=OEfboN-Nb2s
#doas rsync -aAXvz --delete $HOME/Code /media/netdrive/Current #--dry-run
#doas rsync -aAXvz --delete $HOME/Music /media/netdrive/Current #--dry-run
#doas rsync -aAXvz --delete $HOME/Videos /media/netdrive/Current #--dry-run
#doas rsync -aAXvz --delete $HOME/Desktop /media/netdrive/Current #--dry-run
#doas rsync -aAXvz --delete $HOME/Pictures /media/netdrive/Current #--dry-run
#doas rsync -aAXvz --delete $HOME/Documents /media/netdrive/Current #--dry-run
#doas rsync -aAXvz --delete $HOME/Applications /media/netdrive/Current #--dry-run

# Enables unicode and 256 bit color support for tmux
alias tmux="tmux -u -2"

# Prints drive info from fstab
alias drives="cat /etc/fstab"

# Adds colors to grep
alias grep="grep --color"

# Make ls use lsd and add extra aliases
alias ls="lsd -X --group-dirs last --color=auto"
alias la="lsd -AX --group-dirs last --color=auto"
alias ll="lsd -Alhv --group-dirs last --color=auto"
alias tree="lsd -X --group-dirs last --color=auto --tree"
alias tree-hidden="lsd -XA --group-dirs last --color=auto --tree"

# Quickly re-source shell rc file
alias shref="source ~/.config/shell/.zshrc"

# Custom shell prompt
alias prompt="clear ; ls"

# Clears and lists
alias cls="clear ; ls"

# For neovim
alias vim="nvim"
alias vi="nvim"

# Aliases for editor
alias edit="\$EDITOR"

# Always enable bc's math lib
alias bc="bc -l"

# Flash a usb drive with dd
#flash () {
#    doas mkfs.vfat -I "$2"
#    doas dd if="$1" of="$2" status=progress bs=1M
#}

# Makes pushing to git quicker: gitpush <commit message>
gp () {
    git add .
    git commit -m "$*"
    git push
}

# Call prompt, ensures shell is finished loading before calling
prompt
